﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AgCIMProductFuncLib
{
    public class ProductLine
    {
        public string ProductName {  get; set; }
        public List<LineFeature> Lines { get; set; }
        public List<PointFeature> PointLayer { get; internal set; }
        public List<PointFeature> ProductLayer { get; internal set; }

        internal void ScaleToWidth(double dx,double minx,double maxY)
        {
            if (Lines != null)
            {
                for (int i = 0; i < Lines.Count; i++)
                {
                    LineFeature line = Lines[i];
                    line.ScaleToWidth(dx, minx, maxY);
                }
            }
            if (PointLayer != null)
            {
                for (int i = 0; i < PointLayer.Count; i++)
                {
                    PointFeature line = PointLayer[i];
                    line.Point.ScaleToWidth(minx, maxY, dx);
                }
            }
            if (ProductLayer != null)
            {
                for (int i = 0; i < ProductLayer.Count; i++)
                {
                    PointFeature line = ProductLayer[i];
                    line.Point.ScaleToWidth(minx, maxY, dx);
                }
            }
        }
    }
}
